package com.zzlzd.drp.domain;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author ceshi
 * @Title:
 * @Package
 * @Description:
 * @date 2021-3-1919:21
 */
public interface ArticleRep extends JpaRepository<ArticleDto,Integer> {

    @Query(nativeQuery=true, value=" SELECT * FROM article WHERE id = ?1")
   public ArticleDto getArticle(int parseInt);

    @Query(nativeQuery=true, value=" SELECT * FROM article order by id desc")
    public List<ArticleDto> findAll();
}
